// 引入 VueRouter
import Vue from 'vue'
import VueRouter from 'vue-router'
import Find from '../views/Find.vue'
import My from '../views/My.vue'
import Part from '../views/Part.vue'
import NotFound from '../views/NotFound.vue'
// 添加到Vue.use() 注册全局
Vue.use(VueRouter)
//创建路由对象
const router = new VueRouter({
  // 配置路由规则
  routes: [
    { path: '/', redirect: '/find' },
    { path: '/find', component: Find, name: 'find' },
    { path: '/my', component: My, name: 'my' },
    { path: '/part', component: Part, name: 'part' },
    { path: '*', component: NotFound },
  ],
  mode: 'history'
})

export default router